#DOLINK
IF(_MOA=1);'   if moa present
CB1;'          reset output 1
ELSE
SB1;'          if not, set output 1
ENDIF;
JP #DOLINK
EN
'
#ZERO_B
MG "...Axis B, WWCalibration bar is being zero-ed"{EA}
B_BUSY=1;
FLB=900000000;BLB=-900000000
OLDACB=_ACB;OLDDCB=_DCB;OLDSPB=_SPB
ACB=25600;DCB=25600;SPB=50000;SHB
MG "...test, if already on -LIMIT, back off, head for it again"{EA}
IF(_TSB&$04=$00);PRB=250000;BGB;MCB;ENDIF
PRB=-200000000;BGB;
MG "...driving to negative limit switch"{EA}
#LPB1;
JP #LPB1,(_TSB&$04=$04);
MCB
MG "...Negative limit tripped, drive forward to clear"{EA}
ACB=50000;DCB=50000;SPB=10000
PRB=5000000;
BGB
#LPB2;
JP #LPB2,(_TSB&$04=$00)
MG "...Negative limit cleared, define zero here"{EA}
STB;MCB;DPB=0;DEB=0;
ACB=OLDACB;DCB=OLDDCB;SPB=OLDSPB;MOB
MG "... ZERO DEFINED"{EA}
MG "...Zeroing complete!"{EA};B_BUSY=0;EN
